vmx: Clean up and fix guest MSR load/save handling:
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 19 Jun 2008 10:09:10 +0000 (11:09 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 19 Jun 2008 10:09:10 +0000 (11:09 +0100)
commitc385f786c2b062e79c92a760ca0973ef0d54371a
tree69de6e548956981e8a8eef795b7552beb0b826c2
parentd9a2559fc45a21e727e44a5261695dbbba8a517b
vmx: Clean up and fix guest MSR load/save handling:
 1. msr_bitmap/msr_area/msr_host_area must be freed when a vcpu is
    destroyed
 2. vmx_create_vmcs()/vmx_destroy_vmcs() are only ever called once,
    and can hence be simplified slightly
 3. Change vmx_*_msr() interfaces to make it crystal clear that they
    operate only on current (hence safe against vmwrite() and also
    against concurrency races).
 4. Change vmx_add_*_msr() implementation to make it crystal clear
    that msr_area is not dereferenced before it is allocated.

Only (1) is a bug fix. (2)-(4) are for code clarity.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vpmu_core2.c
xen/include/asm-x86/hvm/vmx/vmcs.h